import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);
import axios from "axios";
import moduleA from "./moduleA";

export default new Vuex.Store({
  state: {
    list: [],
  },

  getters: {},
  mutations: {
    add(state) {},
    setData(state, val) {
      state.list = val;
    },
  },
  actions: {
    getData(context) {
      axios.get("xxxxx").then((res) => {
        context.commit("setData", res);
      });
    },
  },
  modules: {
    moduleA,
  },
});
